<template>
    <div class="yzg-head ">
      <section class="page-back router-link-active flex flex-center" @click.stop="goBack">
        <i  class="icon-left2 ule-icon"></i>
      </section>
      <p class="text-title" style="font-size:18px;">{{title}}</p>
      <p class="seleBtn" @click.stop="clickFun">{{rightTitle}}</p>
    </div>
</template>
<script>
export default {
  name: "Head",
  props: {
    title: String,
    rightTitle: { type: [String, null], default: "" },
    clickFun: Function
  },
  methods: {
    goBack() {
      if (this.$route.name == "home") {
        location.href = "ulemobile://ulePopView";
      } else {
        this.$router.go(-1);
      }
    }
  }
};
</script>
<style scoped>
.yzg-head {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 0 10px;
  height: 50px;
  line-height: 50px;
  border-bottom: 1px solid #eee;
  z-index: 100;
  background-color: #c50a1d;
  text-align: center;
  font-size: 16px;
  color: #fff;
}
.text-title {
  margin: 0 auto;
}
.page-back {
  position: absolute;
  left: 0;
  width: 40px;
  height: 100%;;
}
.seleBtn {
  position: absolute;
  top: 0;
  right: 10px;
}
</style>

